Spread Silverlight Documentation
Evaluate(Object[]) Method


GrapeCity.CalcEngine.Functions Namespace > CalcIfFunction Class > Evaluate Method : Evaluate(Object[]) Method

The args contains three items: logical_test, value_if_true and value_if_false.

logical_test is any value or expression that can be evaluated to true or false. For example, A10=100 is a logical expression; if the value in cell A10 is equal to 100, the expression evaluates to true. Otherwise, the expression evaluates to false. This argument can use any comparison calculation operator.

value_if_true is the value that is returned if logical_test is true. For example, if this argument is the text string "Within budget" and the logical_test argument evaluates to true, then the IF function displays the text "Within budget". If logical_test is true and value_if_true is blank, this argument returns 0 (zero). To display the word true, use the logical value true for this argument. Value_if_true can be another formula.

value_if_false is the value that is returned if logical_test is false. For example, if this argument is the text string "Over budget" and the logical_test argument evaluates to false, then the IF function displays the text "Over budget". If logical_test is false and value_if_false is omitted, (that is, after value_if_true, there is no comma), then the logical value false is returned. If logical_test is false and value_if_false is blank (that is, after value_if_true, there is a comma followed by the closing parenthesis), then the value 0 (zero) is returned. Value_if_false can be another formula.

Returns one value if a condition you specify evaluates to true and another value if it evaluates to false.
Syntax
'Declaration
 
Public Overloads Overrides Function Evaluate( _
   ByVal args() As System.Object _
) As System.Object
'Usage
 
Dim instance As CalcIfFunction
Dim args() As System.Object
Dim value As System.Object
 
value = instance.Evaluate(args)
public override System.object Evaluate( 
   System.object[] args
)

Parameters

args

The args contains three items: logical_test, value_if_true and value_if_false.

logical_test is any value or expression that can be evaluated to true or false. For example, A10=100 is a logical expression; if the value in cell A10 is equal to 100, the expression evaluates to true. Otherwise, the expression evaluates to false. This argument can use any comparison calculation operator.

value_if_true is the value that is returned if logical_test is true. For example, if this argument is the text string "Within budget" and the logical_test argument evaluates to true, then the IF function displays the text "Within budget". If logical_test is true and value_if_true is blank, this argument returns 0 (zero). To display the word true, use the logical value true for this argument. Value_if_true can be another formula.

value_if_false is the value that is returned if logical_test is false. For example, if this argument is the text string "Over budget" and the logical_test argument evaluates to false, then the IF function displays the text "Over budget". If logical_test is false and value_if_false is omitted, (that is, after value_if_true, there is no comma), then the logical value false is returned. If logical_test is false and value_if_false is blank (that is, after value_if_true, there is a comma followed by the closing parenthesis), then the value 0 (zero) is returned. Value_if_false can be another formula.

Return Value

A System.Object value that indicates the evaluate result.
See Also

Reference

CalcIfFunction Class
CalcIfFunction Members
Overload List